require("utils.functions")
require("init")
disable_global()
require("utils.init")

local function __G__TRACKBACK__(message)
    --
    local traceback = debug.traceback()
    local errors = "\nERROR: " .. message .. "\n"
    errors = errors .. ">>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
    errors = errors .. traceback .. "\n"
    errors = errors .. "<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"

    Debug.LogError(errors)
end

local function main()
    math.randomseed(os.time())
    local protobuf = require("pbc.protobuf")
    local buffer = G_ResourceManager:loadProto()
    protobuf.register(buffer)
    G_UserData:init()

    require("view.login.LoginView").new()
end

local status, msg = xpcall(main, __G__TRACKBACK__)
if not status then
    Debug.LogError(msg)
end
